package com.xauto.pioneer.appuser.model;

import android.util.Log;

import org.json.JSONObject;

import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import java.util.logging.Logger;

/**
 * Created by Ellis.Li on 2017/5/4.
 */
public class WebInfo extends BaseModel<WebInfo> {

    /** 数据包*/
    public String data_type;
    /** 数据包*/
    public DataValue data_value;

    public class DataValue extends BaseModel<DataValue> {

        /** 数据包*/
        public String title;
        /** 数据包*/
        public String content;

        @Override
        public DataValue parse(JSONObject jsonObject) {
            if (jsonObject != null) {
                title = jsonObject.optString("title");
                content = jsonObject.optString("content").replace("amp;","");
                return this;
            }
            return null;
        }
    }

    @Override
    public WebInfo parse(JSONObject jsonObject) {
        if (jsonObject != null) {
            data_type = jsonObject.optString("data_type");
            data_value = new DataValue().parse(jsonObject.optJSONObject("data_value"));
            return this;
        }
        return null;
    }
}
